package com.dailyblue.java.spring.ioc.demo4;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

// 作用就是产生对象 等同于<bean> 默认名称是类名首字母小写
@Component
/*@Repository
@Service
@Controller*/
public class DemoA {
    @Value("1")
    private Integer a;
    @Value("张三")
    private String b;

    @Override
    public String toString() {
        return "DemoA{" +
                "a=" + a +
                ", b='" + b + '\'' +
                '}';
    }
}
